# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ProximityBeacon.V1beta1.Model.Beacon do
  @moduledoc """
  Details of a beacon device.

  ## Attributes

  *   `advertisedId` (*type:* `GoogleApi.ProximityBeacon.V1beta1.Model.AdvertisedId.t`, *default:* `nil`) - The identifier of a beacon as advertised by it. This field must be
      populated when registering. It may be empty when updating a beacon
      record because it is ignored in updates.

      When registering a beacon that broadcasts Eddystone-EID, this field
      should contain a "stable" Eddystone-UID that identifies the beacon and
      links it to its attachments. The stable Eddystone-UID is only used for
      administering the beacon.
  *   `beaconName` (*type:* `String.t`, *default:* `nil`) - Resource name of this beacon. A beacon name has the format
      "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by
      the beacon and N is a code for the beacon's type. Possible values are
      `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon.

      This field must be left empty when registering. After reading a beacon,
      clients can use the name for future operations.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Free text used to identify and describe the beacon. Maximum length 140
      characters.
      Optional.
  *   `ephemeralIdRegistration` (*type:* `GoogleApi.ProximityBeacon.V1beta1.Model.EphemeralIdRegistration.t`, *default:* `nil`) - Write-only registration parameters for beacons using Eddystone-EID
      (remotely resolved ephemeral ID) format. This information will not be
      populated in API responses. When submitting this data, the `advertised_id`
      field must contain an ID of type Eddystone-UID. Any other ID type will
      result in an error.
  *   `expectedStability` (*type:* `String.t`, *default:* `nil`) - Expected location stability. This is set when the beacon is registered or
      updated, not automatically detected in any way.
      Optional.
  *   `indoorLevel` (*type:* `GoogleApi.ProximityBeacon.V1beta1.Model.IndoorLevel.t`, *default:* `nil`) - The indoor level information for this beacon, if known. As returned by the
      Google Maps API.
      Optional.
  *   `latLng` (*type:* `GoogleApi.ProximityBeacon.V1beta1.Model.LatLng.t`, *default:* `nil`) - The location of the beacon, expressed as a latitude and longitude pair.
      This location is given when the beacon is registered or updated. It does
      not necessarily indicate the actual current location of the beacon.
      Optional.
  *   `placeId` (*type:* `String.t`, *default:* `nil`) - The [Google Places API](/places/place-id) Place ID of the place where
      the beacon is deployed. This is given when the beacon is registered or
      updated, not automatically detected in any way.
      Optional.
  *   `properties` (*type:* `map()`, *default:* `nil`) - Properties of the beacon device, for example battery type or firmware
      version.
      Optional.
  *   `provisioningKey` (*type:* `String.t`, *default:* `nil`) - Some beacons may require a user to provide an authorization key before
      changing any of its configuration (e.g. broadcast frames, transmit power).
      This field provides a place to store and control access to that key.
      This field is populated in responses to `GET /v1beta1/beacons/3!beaconId`
      from users with write access to the given beacon. That is to say: If the
      user is authorized to write the beacon's confidential data in the service,
      the service considers them authorized to configure the beacon. Note
      that this key grants nothing on the service, only on the beacon itself.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Current status of the beacon.
      Required.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :advertisedId => GoogleApi.ProximityBeacon.V1beta1.Model.AdvertisedId.t(),
          :beaconName => String.t(),
          :description => String.t(),
          :ephemeralIdRegistration =>
            GoogleApi.ProximityBeacon.V1beta1.Model.EphemeralIdRegistration.t(),
          :expectedStability => String.t(),
          :indoorLevel => GoogleApi.ProximityBeacon.V1beta1.Model.IndoorLevel.t(),
          :latLng => GoogleApi.ProximityBeacon.V1beta1.Model.LatLng.t(),
          :placeId => String.t(),
          :properties => map(),
          :provisioningKey => String.t(),
          :status => String.t()
        }

  field(:advertisedId, as: GoogleApi.ProximityBeacon.V1beta1.Model.AdvertisedId)
  field(:beaconName)
  field(:description)

  field(:ephemeralIdRegistration,
    as: GoogleApi.ProximityBeacon.V1beta1.Model.EphemeralIdRegistration
  )

  field(:expectedStability)
  field(:indoorLevel, as: GoogleApi.ProximityBeacon.V1beta1.Model.IndoorLevel)
  field(:latLng, as: GoogleApi.ProximityBeacon.V1beta1.Model.LatLng)
  field(:placeId)
  field(:properties, type: :map)
  field(:provisioningKey)
  field(:status)
end

defimpl Poison.Decoder, for: GoogleApi.ProximityBeacon.V1beta1.Model.Beacon do
  def decode(value, options) do
    GoogleApi.ProximityBeacon.V1beta1.Model.Beacon.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ProximityBeacon.V1beta1.Model.Beacon do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
